package com.stx.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.stx.pojo.Player;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PlayerMapper extends BaseMapper<Player> {


    @Select("select * from r_player;")
    List<Player> selectplayer();

    @Select("select * from r_player where pla_name = #{plaName} limit 1")
    Player findByName(String plaName);

    @Insert("insert into r_player(id,pla_name,pla_gender,pla_department,pla_state,pla_avatar,pla_date)"+
            "values (#{id},#{plaName},#{plaGender},#{plaDepartment},#{plaState},#{plaAvatar},#{plaDate})")
    void add(Player player);

    @Update("update r_player set pla_name=#{plaName},pla_gender=#{plaGender},pla_department=#{plaDepartment},pla_state=#{plaState},pla_avatar=#{plaAvatar} where id=#{id}")
    void updateID(Player player);

    @Delete("delete from r_player where id=#{id}")
    void deleteID(Integer id);
}
